﻿// <copyright file="IPriorityQueueCustom.cs" company="Gustavo Franco">
// Copyright (c) 2006 All Right Reserved
// </copyright>
// <author>Gustavo Franco</author>
// <email>gustavo_franco@hotmail.com</email>
// <date>2006</date>
// <summary>Interface for a custom queue that is organized based on priority.</summary>

// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER
// REMAINS UNCHANGED.

// Email:  gustavo_franco@hotmail.com

// Copyright (C) 2006 Franco, Gustavo

// Work done by Robert Tenney on this library: PathFinder, is based off of the previous work
// done by: Franco, Gustavo.

using System;

namespace TenneySoftware.Engine.Algorithms.Pathfinder {
    #region Interfaces
    /// <summary>
    /// Interface for a custom queue that is organized based on priority.
    /// </summary>
    /// <typeparam name="T">The first generic type parameter.</typeparam>
    [Author("Franco, Gustavo")]
    public interface IPriorityQueueCustom<T> {
        #region Methods
		/// <summary>
		/// Push an object onto the priority queue.
		/// </summary>
		/// <param name="item">The new object.</param>
		/// <returns>
		/// The index in the list where the object is now. This will change when objects are taken from or put onto the priority queue.
		/// </returns>
        int Push(T item);
        
		/// <summary>
		/// Get the smallest object and remove it.
		/// </summary>
		/// <returns>The smallest object.</returns>
        T Pop();
        
		/// <summary>
		/// Get the smallest object without removing it.
		/// </summary>
		/// <returns>The smallest object.</returns>
        T Peek();
        
		/// <summary>
		/// Notify the priority queue that the object at position i has changed
		/// and the PQ needs to restore order.
		/// Since you dont have access to any indexes (except by using the
		/// explicit IList.this) you should not call this function without knowing exactly
		/// what you do.
		/// </summary>
		/// <param name="i">The index of the changed object.</param>
        void Update(int i);
        #endregion
    }
    #endregion
}
